package com.ztesoft.web.common.vo;

import com.ztesoft.iocp.cipher.util.RSAUtils;

public class HostInfoPOJO {
	
	private String osType;
	
	//	private HostInfoPOJO(){};
	
		public String getOsType() {
		return osType;
	}
	
	public void setOsType(String osType) {
		this.osType = osType;
	}

	/**
	 * 
	 * @param hostIp ip
	 * @param userName 用户名
	 * @param pwd 密码
	 * @param port 端口
	 * @param isEncrypt 是否有加密
	 */
	public HostInfoPOJO(String osType, String hostIp, String userName, String pwd, int port,
			boolean isEncrypt) {
		super();
		this.osType = osType.toLowerCase();// zuo做小写处理~
		this.hostIp = hostIp;
		this.userName = userName;
		this.pwd = pwd;
		this.port = port;
		this.isEncrypt = isEncrypt;
		if (isEncrypt) {
			this.pwd = RSAUtils.decryptString(pwd);	
			if (this.pwd == null) this.pwd = pwd;
		}
	}

	private String hostIp;
	
	private String userName;
	
	private String pwd;
	
	private int port;
	
	private boolean isEncrypt;

	public boolean isEncrypt() {
		return isEncrypt;
	}

	public void setEncrypt(boolean isEncrypt) {
		this.isEncrypt = isEncrypt;
	}

	public String getHostIp() {
		return hostIp;
	}

	public void setHostIp(String hostIp) {
		this.hostIp = hostIp;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getPwd() {
		return pwd;
	}

	public void setPwd(String pwd) {
		if (isEncrypt) 
			this.pwd = RSAUtils.decryptString(pwd);// modified by lin.wb密码解密处理
		this.pwd = pwd;
	}

	public int getPort() {
		return port;
	}

	public void setPort(int port) {
		this.port = port;
	}
	
	
}
